﻿namespace EFS.RC.CC.Sessions.OfficeService.Operators
{
	/// <summary>
	/// Operator invited session
	/// </summary>
	internal class Invited : EFS.RC.CC.Sessions.OfficeService.Operators.Operator
	{
		#region Delegates

		#endregion

		#region Constructor

		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="conversation"></param>
		/// <param name="remoteEndpoint"></param>
		public Invited(
			EFS.RC.CC.Presences.Operators.Presence operatorPresence,
			EFS.RC.CC.Sessions.OfficeService.Customers.Customer customerSession)
			: base(operatorPresence, customerSession)
		{
			// SAL
			EFS.RC.CC.Tools.Loggers.SAL.Add(CustomerSession.ConversationGuid, "Invited:ctor", OperatorPresence.User.SIP, GetType());
		}

		#endregion

		#region Usage

		/// <summary>
		/// Describe this object into a nice formated string
		/// </summary>
		/// <returns></returns>
		public override System.String Describe()
		{
			return System.String.Format(System.String.Format("EFS.RC.CC.Sessions.OfficeService.Operators.Invited [{0}] [{1}]", OperatorPresence.Describe(), CustomerSession.Describe()));
		}

		#endregion

		#region Startup

		/// <summary>
		/// Startup
		/// </summary>
		protected override void SetupSession()
		{
			// log
			EFS.EventLog.Log.LogInfo("SetupSession", this);

			// SAL
			EFS.RC.CC.Tools.Loggers.SAL.Add(CustomerSession.ConversationGuid, "SetupSession", this); 

			// register opertor session
			CustomerSession.OfficeServiceConference.SetOperatorSession(this);

			// established
			AsinkEstablishedDelegate.Start();
		}

		#endregion

		#region Runtime

		#endregion

		#region Shutdown

		/// <summary>
		/// Cleanup
		/// </summary>
		protected override void CleanupSession()
		{
			// SAL
			EFS.RC.CC.Tools.Loggers.SAL.Add(CustomerSession.ConversationGuid, "CleanupSession", this); 
		}

		#endregion
	}
}
